package com.pe.cineplanet.proyectocine.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.pe.cineplanet.proyectocine.domain.Local;
import com.pe.cineplanet.proyectocine.repository.LocalRepository;

@Controller
public class LocalesController {

	@Autowired
	LocalRepository daoLocal;

	@RequestMapping(value = "/locales")
	public String index(Model model) {

		List<Local> locales = daoLocal.obtenerLocales();
		model.addAttribute("data", locales);
		return "vistaLocal";

	}

}
